#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableAutoChessGroupDao:DaoBase<TableAutoChessGroup>
    {
        public override string GetFileName()
        {
            return "TableAutoChessGroup.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableAutoChessGroup>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableAutoChessGroup model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.acHeroGroup)) UnityEngine.Debug.LogError("数据表id重复:TableAutoChessGroup->id: " + model.acHeroGroup);
            #endif
            cachePrimaryInt[model.acHeroGroup] = model;
        }
        protected override TableAutoChessGroup ParseRowData(string[] rowData)
        {
            TableAutoChessGroup data = new TableAutoChessGroup();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.acHeroGroup = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.groupType = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.flagAssetId = rowData[2];
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.desc = rowData[3];
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.altasName = rowData[4];
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.type = int.Parse(rowData[5]);
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.buffId = rowData[6];
            }
            if (!string.IsNullOrEmpty(rowData[7]))
            {
                data.groupDesc = rowData[7];
            }
            if (!string.IsNullOrEmpty(rowData[8]))
            {
                data.groupSkillName = rowData[8];
            }
            return data;
        }
    }
}
